package org.lw.consumer.feign;

import com.alibaba.csp.sentinel.slots.block.degrade.DegradeException;
import org.springframework.stereotype.Component;

@Component
public class ProviderClientFallBack implements ProviderClient {
    @Override
    public String findProvider(String username) {
        return "Something is wrong( Circuit Breaking)....";
    }

    @Override
    public String hello() {
        return "Something is wrong( Circuit Breaking)....";
    }

    @Override
    public String deduct(Long productId, Integer count) throws DegradeException {
        throw  new DegradeException("Remote service call is too slow","Remote service call is too slow");
    }
}
